﻿function SetForReply(ReplyID,UserID) {
    $.dboxDialog({
        title: '',
        content: '回复设置',
        button: [
            {
                text: '锁定',
                callback: function () {
                    SetStatus(false);
                }
            },
            {
                text: '取消锁定',
                callback: function () {
                    SetStatus(true);
                }
            },
            {
                text: '锁定用户',
                callback: function () {
                    SetForUser(UserID, true);
                }
            },
            {
                text: '取消锁定',
                callback: function () {
                    SetForUser(UserID, false);
                }
            }
        ],
        follow: $("#reply_" + ReplyID),
        opacity:0.6
    });
    var SetStatus = function (Status) {
        $.ajax({
            type: 'post',
            url: '/admin',
            data: 't=SetStatusForReply&Status=' + Status + '&ReplyID=' + ReplyID,
            success: function (result) {
                if (result == "competence") {
                    AloneTips("您没有执行此操作的权限");
                }
                if (result != "" && result != "competence") {
                    AloneTips(result);
                }
            }
        });
    };
}
//用户管理设置
function SetForUser(UserID,Status) {
    $.ajax({
        type: 'post',
        url: '/admin',
        data: 't=SetStatusForUser&Status=' + Status + '&UserID=' + UserID,
        success: function (result) {
            if (result == "competence") {
                AloneTips("您没有执行此操作的权限");
            }
            if (result != "" && result != "competence") {
                AloneTips(result);
            }
        }
    });
}
//主题管理设置部分
function SetForPosts(PostsID,UserID) {
    $.dboxDialog({
        title: '',
        content:'有云设置',
        ok: function () {
            $.ajax({
                type: 'post',
                url: '/admin',
                data: 't=SetPropertyForPosts&Property=9&PostsID=' + PostsID,
                success: function (result) {
                    if (result == "competence") {
                        AloneTips("您没有执行此操作的权限");
                    }
                    if (result != "" && result != "competence") {
                        AloneTips(result);
                    }
                }
            });
        },
        okText: '推荐到首页',
        button: [
            {
                text: '锁定',
                callback: function () {
                    SetStatus(false);
                }
            },
            {
                text: '取消锁定',
                callback: function () {
                    SetStatus(true);
                }
            },
            {
                text: '锁定用户',
                callback: function () {
                    SetForUser(UserID, true);
                }
            },
            {
                text: '取消锁定',
                callback: function () {
                    SetForUser(UserID, false);
                }
            }
        ],
        follow: $("#posts_" + PostsID),
        opacity: 0.6
    });
    var SetStatus = function (Status) {
        $.ajax({
            type: 'post',
            url: '/admin',
            data: 't=SetStatusForPosts&Status=' + Status + '&PostsID=' + PostsID,
            success: function (result) {
                if (result == "competence") {
                    AloneTips("您没有执行此操作的权限");
                }
                if (result != "" && result != "competence") {
                    AloneTips(result);
                }
            }
        });
    };
}